package com.njuse.jvmfinal.memory.jclass.runtimeConstantPool.constant.ref;

import com.njuse.jvmfinal.Starter;
import com.njuse.jvmfinal.loading.loader;
import com.njuse.jvmfinal.memory.jclass.JClass;
import com.njuse.jvmfinal.memory.jclass.runtimeConstantPool.RuntimeConstantPool;
import com.njuse.jvmfinal.memory.jclass.runtimeConstantPool.constant.Constant;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public abstract class SymRef implements Constant {
    public RuntimeConstantPool runtimeConstantPool;
    public String className;    //format : java/lang/Object
    public JClass clazz=null;

    public JClass findclass() {
    	if (clazz==null) {
    		clazz=loader.getinstance().load(className, Starter.startcp, runtimeConstantPool.getClazz().getPreference()); 		
    	}
    	return clazz;
    }
}
